<template>
	<view>
		<view class="height100 tn-mt-lg"></view>
		<view
			class="tn-flex items-center justify-around tn-mt-sm position-fixed fixed-bottom tn-w-full bg-white tn-p-sm">
			<view class="btn tn-type-primary_bg flex1 tn-flex justify-center tn-mr-sm" @click="mobile"><tn-icon
					name="phone-fill" size="xl" />拨号</view>
			<view class="btn tn-type-primary_bg flex1 tn-flex justify-center position-relative" @click="chat"><tn-icon
					name="reply-fill" size="xl" />聊天<tn-badge :value="''" type="danger" />
			</view>
			<view class="btn tn-type-primary_bg flex1 tn-flex justify-center tn-ml-sm" @click="like"><tn-icon
					:name="props.like?'like-fill':'like'" size="xl" />关注</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
	import { gotoPage } from '@/util/util';
	interface Props {
		like : number | boolean,
		phone : string,
		user_id : number,
	}

	const props = defineProps<Props>()
	const emit = defineEmits(['like'])

	const like = () => {
		emit('like')
	}

	const mobile = () => {
		uni.makePhoneCall({
			phoneNumber: props.phone
		})
	}

	const chat = () => {
		gotoPage(`/pages/chat/chat?to_uid=${props.user_id}`)
	}
</script>

<style>

</style>